package com.cloudbroker.bcs.platform.dav.bizapi.constants.status;

public enum PrizeExchangeStatus {
    
    /**
     * 已申请
     */
    APPLIED(1, "已申请"),
    
    /**
     * 已发放
     */
    DELIVERED(2, "已发放"),
    
    /**
     * 已收货
     */
    RECEIVED(3, "已收货"),
    
    /**
     * 已收货
     */
    FORBIDDEN(4, "已禁止");
    
    private final int val;
    
    private final String description;
    
    private String toString;
    
    private PrizeExchangeStatus(int val, String description) {
        this.val = val;
        this.description = description;
    }
    
    public int getVal() {
        return val;
    }
    
    public String getDescription() {
        return description;
    }
    
    public static String getDescription(int val) {
        for (PrizeExchangeStatus taskStatus : PrizeExchangeStatus.values()) {
            if (taskStatus.getVal() == val) {
                return taskStatus.getDescription();
            }
        }
        return String.valueOf(val);
    }
    
    @Override
    public String toString() {
        if (null == toString) {
            toString = new StringBuilder().append("PrizeExchangeStatus[").append(val).append(':')
                    .append(description).append(']').toString();
        }
        return toString;
    }
    
}
